const express = require("express");
const app = express();
const models = require("./models");



// 设置跨域
app.use((req, res, next) => {
    res.header('Access-Control-Allow-Origin', '*'); // 允许任何源
    res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE'); // 允许的HTTP方法
    res.header('Access-Control-Allow-Headers', 'Content-Type'); // 允许的HTTP请求头
    next();
});


app.get("/",(req,res)=>{
    res.send("hello word");
})


models(app);




app.listen(3000,()=>{
    console.log("监听3000");
})